package com.ruoyi.web.controller.bus;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.TbDetectionRlStandard;
import com.ruoyi.system.service.ITbDetectionRlStandardService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 熔炼炉铁水标准Controller
 *
 * @author ruoyi
 * @date 2025-02-11
 */
@RestController
@RequestMapping("/bus/detectionrlstandard")
public class TbDetectionRlStandardController extends BaseController
{
    @Autowired
    private ITbDetectionRlStandardService tbDetectionRlStandardService;

    /**
     * 查询熔炼炉铁水标准列表
     */
    @PreAuthorize("@ss.hasPermi('bus:detectionrlstandard:list')")
    @GetMapping("/list")
    public TableDataInfo list(TbDetectionRlStandard tbDetectionRlStandard)
    {
        startPage();
        List<TbDetectionRlStandard> list = tbDetectionRlStandardService.selectTbDetectionRlStandardList(tbDetectionRlStandard);
        return getDataTable(list);
    }

    /**
     * 导出熔炼炉铁水标准列表
     */
    @PreAuthorize("@ss.hasPermi('bus:detectionrlstandard:export')")
    @Log(title = "熔炼炉铁水标准", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, TbDetectionRlStandard tbDetectionRlStandard)
    {
        List<TbDetectionRlStandard> list = tbDetectionRlStandardService.selectTbDetectionRlStandardList(tbDetectionRlStandard);
        ExcelUtil<TbDetectionRlStandard> util = new ExcelUtil<TbDetectionRlStandard>(TbDetectionRlStandard.class);
        util.exportExcel(response, list, "熔炼炉铁水标准数据");
    }

    /**
     * 获取熔炼炉铁水标准详细信息
     */
    @PreAuthorize("@ss.hasPermi('bus:detectionrlstandard:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(tbDetectionRlStandardService.selectTbDetectionRlStandardById(id));
    }

    /**
     * 新增熔炼炉铁水标准
     */
    @PreAuthorize("@ss.hasPermi('bus:detectionrlstandard:add')")
    @Log(title = "熔炼炉铁水标准", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TbDetectionRlStandard tbDetectionRlStandard)
    {
        return toAjax(tbDetectionRlStandardService.insertTbDetectionRlStandard(tbDetectionRlStandard));
    }

    /**
     * 修改熔炼炉铁水标准
     */
    @PreAuthorize("@ss.hasPermi('bus:detectionrlstandard:edit')")
    @Log(title = "熔炼炉铁水标准", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody TbDetectionRlStandard tbDetectionRlStandard)
    {
        return toAjax(tbDetectionRlStandardService.updateTbDetectionRlStandard(tbDetectionRlStandard));
    }

    /**
     * 删除熔炼炉铁水标准
     */
    @PreAuthorize("@ss.hasPermi('bus:detectionrlstandard:remove')")
    @Log(title = "熔炼炉铁水标准", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(tbDetectionRlStandardService.deleteTbDetectionRlStandardByIds(ids));
    }
}
